<?php
$arr = [
'/downloadfiles/42.xls',
'/downloadfiles/43.xls',
'/downloadfiles/44.xls',
'/downloadfiles/2013年中国卫生统计.pdf',
'/downloadfiles/41.doc',
'/downloadfiles/38.doc',
'/downloadfiles/39.doc',
'/downloadfiles/40.doc',
'/htmleditor/uploadFiles/pic604328344_135328_3432_合影.jpg',
'/htmleditor/uploadFiles/pic604328344_135413_8750_会场.jpg',
'/htmleditor/uploadFiles/pic604328344_14254_8227_房书亭.jpg',
'/htmleditor/uploadFiles/pic604328344_14312_6640_李光甫.jpg',
'/htmleditor/uploadFiles/pic419788088_1730_3670_中药炮制.jpg',
'/htmleditor/uploadFiles/pic419788088_17320_2882_中药制剂.jpg',
'/htmleditor/uploadFiles/pic555890414_10368_2414_会长会123.jpg',
'/htmleditor/uploadFiles/pic555890414_10325_3903_会长半夏照片.jpg',
'/upload/zhongyao/bianqiqi/attached/file/20130924/2013092410090614614.doc',
'/downloadfiles/8.doc',
'/downloadfiles/9.doc',
'/downloadfiles/10.doc',
'/downloadfiles/11.doc',
'/downloadfiles/29.doc',
'/downloadfiles/51.doc',
'/downloadfiles/52.doc',
'/downloadfiles/55.doc',
'/downloadfiles/78.doc',
'/downloadfiles/79.doc',
'/downloadfiles/81.doc',
'/downloadfiles/83.doc',
'/downloadfiles/93.doc',
'/downloadfiles/123.doc',
'/downloadfiles/122.doc',
'/downloadfiles/130.doc',
'/downloadfiles/131.doc',
'/downloadfiles/135.doc',
'/downloadfiles/135.doc',
'/downloadfiles/138.doc',
'/downloadfiles/137.doc',
'/downloadfiles/147.doc',
'/downloadfiles/171.doc',
'/downloadfiles/171.doc',
'/downloadfiles/172.doc',
'/downloadfiles/172.doc',
'/downloadfiles/173.doc',
'/downloadfiles/174.doc',
'/downloadfiles/191.doc',
'/downloadfiles/192.doc',
'/downloadfiles/184.doc',
'/downloadfiles/185.doc',
'/downloadfiles/186.xls',
'/downloadfiles/187.doc',
'/downloadfiles/188.doc',
'/downloadfiles/194.doc',
'/downloadfiles/195.doc',
'/downloadfiles/196.doc',
'/downloadfiles/197.doc',
'/downloadfiles/198.doc',
'/downloadfiles/200.mht',
'/downloadfiles/203.xls',
'/downloadfiles/204.doc',
'/downloadfiles/205.doc',
'/downloadfiles/206.doc',
'/downloadfiles/207.pdf',
'/downloadfiles/208.pdf',
'/downloadfiles/209.doc',
'/downloadfiles/210.doc',
'/downloadfiles/210.doc',
'/downloadfiles/211.doc',
'/downloadfiles/212.doc',
'/downloadfiles/214.doc',
'/downloadfiles/215.doc',
'/downloadfiles/216.doc',
'/downloadfiles/218.doc',
'/downloadfiles/219.xls',
'/downloadfiles/220.doc',
'/downloadfiles/221.doc',
'/htmleditor/uploadFiles/pic766899876_16447_5075_03-15页.jpg',
'/downloadfiles/230.doc',
'/downloadfiles/231.doc',
'/downloadfiles/231.doc',
'/downloadfiles/231.doc',
'/downloadfiles/232.doc',
'/downloadfiles/233.doc',
'/downloadfiles/234.doc',
'/downloadfiles/235.doc',
'/downloadfiles/236.doc',
'/downloadfiles/237.xls',
'/downloadfiles/238.doc',
'/downloadfiles/239.doc',
'/downloadfiles/240.doc',
'/downloadfiles/241.doc',
'/downloadfiles/242.doc',
'/downloadfiles/246.doc',
'/downloadfiles/243.doc',
'/downloadfiles/247.doc',
'/downloadfiles/244.doc',
'/downloadfiles/245.doc',
'/downloadfiles/248.doc',
'/downloadfiles/249.doc',
'/downloadfiles/250.doc',
'/downloadfiles/251.doc',
'/downloadfiles/252.doc',
'/downloadfiles/253.doc',
'/downloadfiles/257.xls',
'/downloadfiles/256.doc',
'/downloadfiles/268.doc',
'/downloadfiles/269.doc',
'/downloadfiles/lin.doc',
'/downloadfiles/lin.doc',
'/downloadfiles/271.xls',
'/downloadfiles/271.xls',
'/downloadfiles/272.doc',
'/downloadfiles/273.doc',
'/downloadfiles/276.doc',
'/downloadfiles/276.doc',
'/downloadfiles/276.doc',
'/downloadfiles/276.doc',
'/downloadfiles/277.doc',
'/downloadfiles/279.xls',
'/downloadfiles/281.doc',
'/downloadfiles/282.doc',
'/downloadfiles/282.doc',
'/downloadfiles/283.doc',
'/downloadfiles/283.doc',
'/downloadfiles/285.doc',
'/downloadfiles/286.doc',
'/downloadfiles/287.doc',
'/downloadfiles/287.doc',
'/downloadfiles/288.doc',
'/downloadfiles/294.doc',
'/downloadfiles/309.doc',
'/downloadfiles/310.doc',
'/downloadfiles/322.doc',
'/downloadfiles/315.pdf',
'/downloadfiles/316.pdf',
'/downloadfiles/318.doc',
'/downloadfiles/333.doc',
'/downloadfiles/345.doc',
'/downloadfiles/346.doc',
'/downloadfiles/tongzhi.pdf',
'/downloadfiles/355.doc',
'/downloadfiles/356.doc',
'/downloadfiles/358.dot',
'/downloadfiles/360.doc',
'/downloadfiles/361.doc',
'/downloadfiles/372.doc',
'/downloadfiles/374.doc',
'/downloadfiles/yantaohui.pdf',
'/downloadfiles/379.doc',
'/downloadfiles/380.doc',
'/downloadfiles/384.doc',
'/downloadfiles/385.doc',
'/downloadfiles/中国中药协会文件.pdf',
'/downloadfiles/医药展-电子版-01.jpg',
'/downloadfiles/医药展-电子版-02.jpg',
'/downloadfiles/国家局批文.jpg',
'/downloadfiles/396.doc',
'/downloadfiles/398.doc',
'/downloadfiles/399.xls',
'/downloadfiles/400.xls',
'/downloadfiles/401.xls',
'/downloadfiles/402.xls',
'/htmleditor/uploadFiles/pic605751465_154423_5842_QQ截图11.jpg',
'/htmleditor/uploadFiles/pic605751465_154351_6001_QQ截图112.jpg',
'/downloadfiles/406.doc',
'/downloadfiles/407.doc',
'/downloadfiles/412.doc',
'/downloadfiles/417.doc',
'/downloadfiles/418.doc',
'/downloadfiles/419.doc',
'/downloadfiles/420.doc',
'/downloadfiles/421.rar',
'/downloadfiles/421.rar',
'/downloadfiles/421.rar',
'/downloadfiles/424.doc',
'/downloadfiles/附件1中医药行业标准编制通则征求意见稿.pdf',
'/downloadfiles/431.doc',
'/downloadfiles/附件3 中医临床诊疗指南编制通则编制说明.pdf',
'/downloadfiles/附件3 中医临床诊疗指南编制通则编制说明.pdf',
'/downloadfiles/附件3 中医临床诊疗指南编制通则编制说明.pdf',
'/downloadfiles/附件4中医临床诊疗指南编制通则征求意见稿.pdf',
'/downloadfiles/附件5中医临床诊疗指南编制通则意见汇总表.pdf',
'/tuantibiaozhun.rar',
'/PDF/fujian zhongyiyaokoufu.pdf',
'/uploadfile/报批稿-41+41项道地药材特色栽培及产地加工技术规范.rar',
'/uploadfile/编制说明-41+41项道地药材特色栽培及产地加工技术规范.rar',
'/PDF/关于推荐会员企业参与质检总局开展的2017年品牌价值评价工作的函.pdf',
'/PDF/2018年项目库及后备项目申报指南方向.pdf',
'/PDF/2018年项目库及后备项目申报要求.pdf',
'/PDF/2018年项目库及后备项目申报要求.pdf',
'/PDF/2018年度中方后备项目申报材料.rar',
'/PDF/%E9%99%84%E4%BB%B61%E3%80%8A%E4%B8%AD%E5%8C%BB%E8%8D%AF--%E5%A4%A9%E7%84%B6%E4%BA%A7%E5%93%81%E7%94%9F%E4%BA%A7%E8%BF%87%E7%A',
'/wwwroot/pdf/附件3 2019年度中方后备项目申报材料.rar',
'/pdf/附件32019年度中方后备项目申报材料.rar',
'/pdf/附件3 2019年度中方后备项目申报材料.rar',
'/pdf/附件4 ISO中医药国际标准项目申报参考资料.rar',
'/pdf/附件4 ISO中医药国际标准项目申报参考资料.rar',
'/PDF/关于开展2018年品牌价值评价工作的通知.pdf',
'/PDF/关于开展2018年品牌价值评价工作的通知.pdf',
'/PDF/产业扶贫推进活动通知.pdf',
'/uploadfile/%E4%B8%AD%E5%9B%BD%E4%B8%AD%E8%8D%AF%E5%8D%8F%E4%BC%9A%E5%9B%A2%E4%BD%93%E6%A0%87%E5%87%86%E7%AE%A1%E7%90%86%E5%8A%9E%',
'/uploadfile/%E4%B8%AD%E5%9B%BD%E4%B8%AD%E8%8D%AF%E5%8D%8F%E4%BC%9A%E5%9B%A2%E4%BD%93%E6%A0%87%E5%87%86%E7%AE%A1%E7%90%86%E5%8A%9E%',
'/uploadfile/%E4%B8%AD%E5%9B%BD%E4%B8%AD%E8%8D%AF%E5%8D%8F%E4%BC%9A%E5%9B%A2%E4%BD%93%E6%A0%87%E5%87%86%E7%AE%A1%E7%90%86%E5%8A%9E%',
];




$domain = 'http://xxxx.com';

foreach ($arr as $key => $url) {
	echo $key . PHP_EOL;
    $pats = pathinfo($url);
    $dir = '.'.$pats['dirname'].'/';
      if(!is_dir($dir))
       {
        @mkdirs($dir, 0777);
       }
    $img = file_get_contents($domain.$url);
    file_put_contents('.'.$url,$img); 
}

function mkdirs($pathname, $mode = 0755){
 is_dir(dirname($pathname)) || mkdirs(dirname($pathname), $mode);
 return is_dir($pathname) || @mkdir($pathname, $mode);
}